This application relates to and incorporates herein by reference Japanese Patent Application No. 11-270925 filed Sep. 24, 2000 and 2000-26405 filed Feb. 3, 2000.
1. Field of the Invention
The present invention relates to an engine control apparatus for controlling a four-cycle engine and more specifically to discrimination of cylinders of the engine.
2. Related Art
An engine control apparatus has a crank angle sensor which outputs a pulse signal every time when an engine crankshaft rotates by a predetermined angle and outputs a reference position signal, instead of the pulse signal, when the rotational position of the crankshaft comes to preset reference position. It also has a cam angle sensor which outputs a cylinder identification signal whose logical level changes to high level and low level corresponding to rotational position of the engine camshaft which rotates with a rate of 1/2 to the rotation of the crankshaft. The engine control apparatus discriminates cylinders based on the logical level of the cylinder identification signal at timing when the reference position signal is outputted from the crank angle sensor (JP-A-6-213058, for example).
However, in this engine control apparatus, it is unable to discriminate the cylinders normally any longer when the logical level of a cylinder identification signal G does not change (when it is fixed) when an abnormality occurs in a wire from the cam angle sensor to a signal processing circuit of the engine control apparatus or in the cam angle sensor itself because the value of the crank counter is initialized only to either one of 8 and 20 per every 360xc2x0 CA (crankshaft angle).
It is an object of the present invention to enable correct discrimination of cylinders even when an abnormality occurs in a sensor outputting the cylinder identification signal or in its wire.
According to the present invention, a reference position signal is generated at a predetermined reference position of a crankshaft, rotation signals are generated at every predetermined rotation of the crankshaft, and a logical signal is generated in response to a rotation of a shaft rotated at a rate of 1/2 of rotation of the crankshaft so that the logical signal changes a logical level thereof alternately at timing of the reference position signal. The logical level is read in response to the reference position signal. Accumulated angle of rotation of the crankshaft during two rotations of the crankshaft is counted using the rotation signals. The count is initialized to a first value and a second value when the output level read is high and low, respectively.
The initializing operation is inhibited when the logical level read this time coincides with the logical level read previously. Alternatively, it is inhibited when the logical level of the logical signal has not been reversed even once by checking whether the logical level has been reversed during a period from when the logical level has been read previously till when it is read this time. The initializing operation is enabled when it is determined that the logical level of the logical signal read this time |has changed from the logical level read previously. The output level of the logical signal is changed to the one of high and low opposite from the other of high and low when it is discriminated that the level has not changed. Alternatively, the output level of the logical signal is changed to a logical level opposite from the logical level previously read when it is discriminated that the level has not changed.